import Vue from 'vue'
import Router from 'vue-router'
import Home from '@/pages/home/home'
import choose from '@/pages/choose'
import parts from '@/pages/parts'

import classify from "@/pages/Classify/classify"
import goodDetail from '@/pages/Detail/goodDetail'
import change from '@/pages/Detail/Change'
import pay from "@/pages/pay/pay"
import success from '../common/success'

import news from '@/pages/News/news'
import newsDetail from '@/pages/News/newsDetail'

import my from '@/pages/My/my'
import order from '@/pages/order'
import OrderDetails from "@/pages/OrderDetails"
import MyCollection from '@/pages/My/MyCollection'
import address from "@/pages/address"
import add_address from "@/pages/add_address"
import cart from '@/pages/cart/cart'
import author from '@/pages/author'

Vue.use(Router)

export default new Router({
  routes: [
    { path: '/', component: Home },//首页
    { path: '/home', name: 'Home', component: Home,meta:{index:1} },
    { path: '/choose', name: 'choose', component: choose },//选购手机
    { path: '/parts', name: 'parts', component: parts },//选购配件

    { path: '/classify',name:'classify',component:classify},//商品分类
    { path: '/goodDetail', name: 'goodDetail', component: goodDetail,meta:{index:0}},//商品详情
    { path: '/change', name: 'change', component: change },//手机以旧换新
    { path: '/pay',name:'pay',component:pay},//结算
    { path: '/success',name:'success',component:success},//购买成功

    { path: '/news', name: 'news', component: news },//咨询动态
    { path: '/newsDetail', name: 'newsDetail', component: newsDetail },//咨询详情

    { path: '/my', name: 'my', component: my },//个人中心
    { path: '/order', name: 'order', component: order,
      children:[{path: '/order/OrderDetails', name: '/order/OrderDetails', component: OrderDetails,}]
    },//我的订单
    { path: '/MyCollection', name:'MyCollection', component:MyCollection},//我的收藏
    { path: '/address', name:'address', component:address},//管理收货地址
    { path: '/add_address', name:'add_address', component:add_address},//新增地址
    { path: '/cart', name: 'cart', component: cart },//购物车
    { path: '/author', name: 'author', component: author },//关于我
    { path: '/OrderDetails',name:'OrderDetails',component:OrderDetails},//订单详情
  ]
});
